/**
  * Author: Mei
  * Date: 2020-11-21 16:01
  * Description: 
  *
  */
#include <iostream>
#include <cstring>
#include <vector>

using namespace std;

template<typename T, typename R>
class MyTemplateClass {
public:
    void show(T a, R b) {
        cout << "a = " << a << ",b = " << b << endl;
    }

};
//不允许只指定一个类型
//template <typename T>
//typedef MyTemplateClass<T, int> OtherTemplate;
//应该使用这种方法
template<typename T1>
using OtherTemplate = MyTemplateClass<T1, int>;

template<typename type1, typename type2>
auto myFunc(const type1 a, const type2 b) -> decltype(a + b) {
    return a + b;
};

//模板类型参数的默认值
template<typename T, typename Container=vector<T>>
class Grid {
public:
    void show(Container C) {
        cout << C[0] << endl;
    }
};

int main() {
    //OtherTemplate<int> t;
    //t.show(1, 2);

    cout << myFunc<int, int>(1, 2) << endl;
    Grid<int, vector<int>> grid;
    vector<int> c = {1};
    //grid.show(2, c);

    return 0;
}